import request from '@/utils/request'

// 试验委托单列表
export function listTest(params) {
  return request({
    url: '/supervise/experimentApi/list',
    method: 'post',
    params
  })
}

// 删除试验委托单
export function deleteTest(id) {
  return request({
    url: '/supervise/experimentApi/remove',
    method: 'post',
    params: { id }
  })
}

// 新增试验委托单
export function addTest(data) {
  return request({
    url: '/supervise/experimentApi/add',
    method: 'post',
    data: data
  })
}

// 更新试验委托单
export function updateTest(data) {
  return request({
    url: '/supervise/experimentApi/update',
    method: 'post',
    data: data
  })
}

// 试验委托单详情
export function getTestById(id) {
  return request({
    url: '/supervise/experimentApi/get/' + id
  })
}

// 项目成果附件
export function addProjectFile(id) {
  return request({
    url: '/supervise/experimentApi/addProjectFile',
    method: 'post'
  })
}

// 试验单位 选择单位类型弹框
export function listOrgType() {
  return request({
    url: '/sys/enterprise/selectSysEnterpriseListByInitNoPermission',
    method: 'post'
  })
}

// 试验单位弹框列表
export function listOrgTypeList(params) {
  return request({
    url: '/sys/enterprise/dailyListNoPermission',
    method: 'post',
    params
  })
}

// 成果报告
export function experimentUploadFile(data) {
  return request({
    url: '/supervise/experimentApi/uploadFile',
    method: 'post',
    data
  })
}

// 查看成果报告
export function getExperiment(id) {
  return request({
    url: `/supervise/experimentApi/get/${id}`
  })
}

// 项目详情试验委托单列表
export function listExperimentApi(params) {
  return request({
    url: '/supervise/experimentApi/listNoPermissiont',
    method: 'post',
    params
  })
}
